<style lang="less">
</style>

<template>
    <div>
        <Card shadow>
            <Tabs type="card" :value="selectPane" @on-click="clickTabs">
                <TabPane label="普通客户" name="1">
                    <member-list ref="list1" :menuId="0" :level="1"></member-list>
                </TabPane>
                <TabPane label="重要客户" name="2">
                    <member-list ref="list2" :menuId="0" :level="2"></member-list>
                </TabPane>
                <TabPane label="VIP客户" name="3">
                    <member-list ref="list3" :menuId="0" :level="3"></member-list>
                </TabPane>
            </Tabs>
        </Card>
    </div>
</template>

<script>
import iviewTable from '@/view/common/table/Table.vue';
import iviewPage from '@/view/common/page/Page.vue';
import memberList from '@/view/business/member/MemberList.vue';
export default {
    name: 'text-editor',
    components: {
        iviewTable,
        iviewPage,
        memberList
    },
    data () {
        return {
            selectPane: '1'
        };
    },
    methods: {
        clickTabs (name) {
            if (name === '1') {
                this.$refs.list1.refresh()
            } else if (name === '2') {
                this.$refs.list2.refresh()
            } else if (name === '3') {
                this.$refs.list3.refresh()
            }
            this.selectPane = name
        },
        init () {
            this.selectPane = '1'
            this.$refs.list1.refresh()
        }
    },
    mounted () {
        this.init()
    },
    watch: {
        '$route' (to) {
            if (to.path === '/statistics/customer') {
                this.init()
            }
        }
    }
}
</script>

<style>

</style>
